/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.example.turn_layout_manager;

import com.cdflynn.ohos.library.turn.Hlog;
import org.junit.Assert;
import org.junit.Test;

/**
 * BigDecimalUtilsTest
 *
 * @author:username
 * @since 2021-05-25
 */
public class BigDecimalUtilsTest {

    private static final float NUMBER_1 = 587.25f;
    private static final float NUMBER_2 = 359.46f;
    private static final float RESULT_1 = 946.71f;
    private static final float RESULT_2 = 227.79f;
    private static final float RESULT_3 = 211092.885f;
    private static final String MESSAGE = "相等吗";

    /**
     * 提供精确的加法运算。
     */
    @Test
    public void add() {
        Float result = BigDecimalUtils.add(NUMBER_1, NUMBER_2);
        Assert.assertEquals(MESSAGE, new Float(RESULT_1), result);
        Hlog.e(result + "");
    }


    /**
     * 提供精确的加法运算。
     */
    @Test
    public void sub() {
        Float result = BigDecimalUtils.sub(NUMBER_1, NUMBER_2);
        Assert.assertEquals(MESSAGE, new Float(RESULT_2), result);
        Hlog.e(result + "");
    }

    /**
     * 提供精确的加法运算。
     */
    @Test
    public void mul() {
        Float result = BigDecimalUtils.mul(NUMBER_1, NUMBER_2);
        Assert.assertEquals(MESSAGE, new Float(RESULT_3), result);
        Hlog.e(result + "");
    }
}